package services;

import domain.entities.InvestigadorProtocoloCentro;
import domain.entities.Vendorcentral;

import java.util.List;
import java.util.regex.Pattern;

/**
 * Created with IntelliJ IDEA.
 * User: Guillermo
 * Date: 09/08/12
 * Time: 15:03
 * To change this template use File | Settings | File Templates.
 */
public class CriteriaCentralVendor extends Criteria{

    private Vendorcentral vendorcentral;

    public CriteriaCentralVendor(Vendorcentral vendorcentral){
        this.vendorcentral = vendorcentral;
    }

    @Override
    public boolean isIn(Object element){
        boolean isIn = true;
        Vendorcentral other = (Vendorcentral)element;

        isIn &= isSubstring(vendorcentral.getName(),other.getName());
        isIn &= isSubstring(vendorcentral.getAddress().getCountry(),other.getAddress().getCountry());
        isIn &= isSubstring(vendorcentral.getType().getId(),other.getType().getId());

        return isIn;
    }
}
